/* 在顶部添加CSS变量 */
:root {
  --app-background: #1a1a2e;
  --panel-background: #16213e;
  --text-color: #fff;
  --secondary-text-color: #a0a0c0;
}

/* Reset default styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#root {
  width: 100%;
  height: 100vh;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
}

.dashboard {
  font-family: Arial, sans-serif;
  background-color: var(--app-background);
  color: var(--text-color);
  padding: 20px;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-info span {
  margin-right: 5px;
}

.timestamp {
  font-size: 0.9em;
  color: var(--secondary-text-color);
  margin-left: 20px;
}

main {
  display: flex;
  gap: 20px;
  height: 85%;
  width: 100%;
  flex: 1;
}

.map-chart, .metrics-panel, .chart-panel {
  background: var(--panel-background);
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.map-chart {
  flex: 2;
  display: flex;
  flex-direction: column;
}

.map-chart h2, .chart-panel h2, .metrics-panel h2 {
  margin-bottom: 15px;
  color: var(--secondary-text-color);
  font-size: 1.2rem;
}

.chart-container {
  position: relative;
  height: 100%;
  width: 100%;
  flex: 1;
}

.metrics-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.metric-item {
  margin-bottom: 15px;
  font-size: 1rem;
  padding: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.sub-metrics {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 15px;
  font-size: 0.9em;
  color: #a0a0c0;
}

.chart-panel {
  flex: 2;
  display: flex;
  flex-direction: column;
}

.chart-row {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  flex: 1;
}

.chart-row .chart-container {
  flex: 1;
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  padding: 10px;
}

/* 加载和错误状态样式 */
.loading-container, .error-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
}

.loading {
  color: #a0a0c0;
  font-size: 1.2rem;
  text-align: center;
  padding: 20px;
  animation: pulse 1.5s infinite;
}

.error {
  color: #ff6b6b;
  font-size: 1.1rem;
  text-align: center;
  padding: 20px;
  background-color: rgba(255, 107, 107, 0.1);
  border-radius: 5px;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

.selected-region {
  font-size: 0.9em;
  color: #4fc3f7;
  font-weight: normal;
}

.metrics-section {
  margin-bottom: 15px;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}

.section-title {
  font-size: 1rem;
  margin-bottom: 10px;
  color: #4fc3f7;
  font-weight: normal;
}

.province-metrics {
  border-left: 2px solid #4fc3f7;
}
